home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 June
/
EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso
/
earcd
/
cmdity
/
yk212src.lha
/
Yak_2.12_Src
/
Include
/
Hotkey_types.h
< prev
next >
Wrap
C/C++ Source or Header
|
1995-12-31
|
6KB
|
249 lines
/*
* Definitions for generic Yak hotkeys.
* mws, 27 April 1993
*/
#ifndef HOTKEY_TYPES_H
#define HOTKEY_TYPES_H
#ifndef EXEC_TYPES_H
#include <exec/types.h>
#endif /* EXEC_TYPES_H */
#ifndef EXEC_NODES_H
#include <exec/nodes.h>
#endif /* EXEC_NODES_H */
#ifndef EXEC_LISTS_H
#include <exec/lists.h>
#endif /* EXEC_LISTS_H */
#ifndef LIBRARIES_COMMODITIES_H
#include <libraries/commodities.h>
#endif /* LIBRARIES_COMMODITIES_H */
/*
* YakOption structure definition
*/
typedef struct {
UWORD Flags;
STRPTR *ArgStr;
LONG *ArgNum;
} YakOption;
/*
* YakHotKey structure definition
*/
typedef struct {
struct Node yhk_Node; /* node for linked-list */
CxObj *yhk_CxObj; /* cx object list */
UWORD yhk_Type; /* hotkey type */
char *yhk_KeyDef; /* actual key definition */
UWORD yhk_State; /* hotkey state */
char *yhk_Name; /* hotkey name */
YakOption *yhk_Option; /* hotkey options */
} YakHotKey;
#define EMPTY_MINLIST {NULL,NULL,NULL}
/*
* Types of hotkey currently supported
*/
#define EXECUTE_COMMAND 0
#define CLOSE_WINDOW 1
#define ZIP_WINDOW 2
#define SHRINK_WINDOW 3
#define EXPAND_WINDOW 4
#define MOVE_WINDOW 5
#define CYCLE_WINDOWS 6
#define OPEN_PALETTE 7
#define SCREEN_TO_FRONT 8
#define SCREEN_TO_BACK 9
#define CENTRE_SCREEN 10
#define ACTIVATE_WORKBENCH 11
#define BLANK_DISPLAY 12
#define INSERT_TEXT 13
#define INSERT_DATE 14
#define SHOW_INTERFACE 15
#define SET_DEF_PUB_SCREEN 16
#define MENU_SHORTCUT 17
#define ICONIFY_WINDOW 18
#define NUM_HOTKEY_TYPES 19
/*
* YakHotKey states.
*/
#define YKHK_INACTIVE 0
#define YKHK_ACTIVE 1
#define NUM_STATES 2
/*
* YakHotKey click types.
*/
#define YKHK_SIMPLE 0
#define YKHK_DOUBLE 1
#define YKHK_TRIPLE 2
#define NUM_CLICKS 3
/*
* This structure describes an option of a hotkey
*/
typedef struct {
UBYTE Type;
UWORD LocalID;
#ifdef PREFS
APTR LabelID;
UWORD ExcludeIDs;
UWORD ActivateIDs;
UWORD DisplayID;
#endif
#if defined(PREFS) || defined(CONV)
UWORD DefFlag;
STRPTR DefArgStr;
LONG DefArgNum;
#endif
} OptDescription;
/* Types */
#define NO_OPT 0
#define TOGGLE_OPT 1
#define STRING_OPT 2
#define INTEGER_OPT 3
typedef struct {
OptDescription *Desc;
#ifdef PREFS
APTR LabelID;
#endif
} OptsList;
/*
* YakHotKeyType structure
*/
typedef struct {
struct MinList yhkt_list; /* list of keys */
#if defined(PREFS) || defined(CONV)
APTR yhkt_nameID; /* locale string identifier for name */
#else
void (*yhkt_Command)(YakHotKey *); /* command to call */
#endif
#ifdef PREFS
char *yhkt_HelpNode; /* online help */
#endif
UWORD yhkt_OptsNum;
OptsList *yhkt_OptsList;
} YakHotKeyType;
/*
* Options
*/
GLOBAL OptDescription ChangeScreenHKOption[];
/* Change Screen */
#define HKO_NO_SCREEN_CHANGE (1<<0)
#define HKO_WORKBENCH_TO_FRONT (1<<1)
#define HKO_DEFAULT_PUBSCR_TO_FRONT (1<<2)
/* Commands */
#define HKO_CLI_COMMAND (1<<0)
#define HKO_AREXX_COMMAND (1<<1)
#define HKO_STACK_COMMAND (1<<2)
#define HKO_PRIORITY_COMMAND (1<<3)
#define HKO_COMMAND (1<<4)
#define HKO_AREXX_PORT (1<<5)
/* Select Window & Screen */
#define HKO_ACTIVE (1<<0)
#define HKO_UNDER_MOUSE (1<<1)
#define HKO_BY_TITLE (1<<2)
#define HKO_PATTERN (1<<3)
#define HKO_REARMOST (1<<4) /* Screen To Front */
#define HKO_FRONTMOST (1<<5) /* Screen To Back */
/* Resize Window */
#define HKO_RESIZE_HORIZONTAL (1<<0)
#define HKO_RESIZE_VERTICAL (1<<1)
#define HKO_RESIZE_VISIBLE_BAR (1<<2)
/* Move Window & Screen */
#define HKO_NO_VERTICAL_MOVING (1<<0)
#define HKO_MOVE_TOP (1<<1)
#define HKO_MOVE_VERTICAL_CENTER (1<<2)
#define HKO_MOVE_BOTTOM (1<<3)
#define HKO_NO_HORIZONTAL_MOVING (1<<4)
#define HKO_MOVE_LEFT (1<<5)
#define HKO_MOVE_HORIZONTAL_CENTER (1<<6)
#define HKO_MOVE_RIGHT (1<<7)
#define HKO_MOVE_VISIBLE_BAR (1<<8) /* Move Window */
#define HKO_MOVE_VISIBLE_ACTIVE (1<<8) /* Move Screen */
/* Cycle Windows */
#define HKO_BACK_CYCLE (1<<0)
#define HKO_EXCLUDE_WB_DRAWERS (1<<1)
#define HKO_BY_WINDOW_TASK_NAME (1<<2)
#define HKO_TASK_NAME_PATTERN (1<<3)
#define HKO_ACTIVATE_ONLY (1<<4)
/* Insert Date */
#define HKO_DATE_FORMAT (1<<0)
/* Insert Text */
#define HKO_INSERT_STRING (1<<0)
#define HKO_INSERT_DELAY (1<<1)
/* Menu */
#define HKO_MENU_NUMBER (1<<0)
#define HKO_ITEM_NUMBER (1<<1)
#define HKO_SUBITEM (1<<2)
#define HKO_SUBITEM_NUMBER (1<<3)
/*
* Info for anyone to examine
*/
extern YakHotKeyType yhktypes[NUM_HOTKEY_TYPES];
extern UWORD num_hkeys;
#define YHK_Takes_Opt(yhk) (yhktypes[(yhk)->yhk_Type].yhkt_OptsNum)
#define keylist(type) ((struct List *)&yhktypes[type].yhkt_list)
#define numkeys(type) yhktypes[type].yhkt_count
/*
* And functions for anyone to call
*/
void PerformAction(YakHotKey *yhk);
void DeleteYakHotKey(YakHotKey *yhk);
int ModifyYHKKeyDef(YakHotKey *yhk, char *keystr);
int ModifyYHKName(YakHotKey *yhk, char *namestr);
YakHotKey *NewYakHotKey(UWORD type);
void InitYakHotKeyList(void);
void DeleteYakHotKeyList(void);
APTR ControlYakHotKey(YakHotKey *yhk);
int OkayToExit(void);
char *DupStr(char *str);
void DefaultOptions(YakHotKey *yhk);
#endif